﻿using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Catchbase.TestTools.UTest
{
    [TestClass]
    public class SubjectTest
    {
        [TestMethod]
        public void Instance_ReturnsInstanceOfT()
        {
            new Subject<Object>(Enumerable.Empty<Object>()).Instance.MustBeInstanceOf(typeof (Object));
        }

        [TestMethod]
        public void Instance_ReturnsInstanceOfTWithSuppliedInjections()
        {
            var o = new object();
            new Subject<SubjectTestHelp>(new[]{o}).Instance.O.MustBeSame(o);
        }

        public class SubjectTestHelp
        {
            public object O;

            public SubjectTestHelp(Object o)
            {
                O = o;
            }
        }
    }
}